<table class="layui-hide" id="test"></table>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
layui.use('table', function(){
  var table = layui.table;
  table.render({
    elem: '#test'
    ,url:'/location/selectAll'
    ,height: 290
    ,limits:[5,10,15]
    ,limit: 5
    ,cols: [[
    	   {type:'numbers'}
    	  ,{field:'LOCATION_ID', width:280, title: 'ID', sort: true}
	      ,{field:'LOCATION_NAME', width:280, title: '名称'}
	      ,{field:'LOCATION_CREAETIME', width:280, title: '创建时间', sort: true}
	      ,{field:'LOCATION_EDITTIME', width:280, title: '编辑时间'}
	      ,{field:'LOCATION_PID', title: '父ID', width:280}
	      ,{field:'LOCATION_DESC', width:280, title: '城市描述', sort: true}
	      ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:200}
    ]]
    ,page: true
  });
});
</script>
